<template>
	<view class="L-main">
		<view class="nav">
			<view @click="$gopage('/pages/index/policyFile')">
				<image src="../../static/workMessage/enterprise_icon2.png" style="height: 63rpx;width: 53rpx;"></image>
				<text>政策文件</text>
			</view>
			<view @click="$gopage('/pages/index/policyConsult')">
				<image src="../../static/workMessage/enterprise_icon3.png" style="height: 57rpx;width: 65rpx;"></image>
				<text>政策咨询</text>
			</view>
			<view>
				<image src="../../static/workMessage/enterprise_icon4.png" style="height: 62rpx;width: 71rpx;"></image>
				<text>企业帮扶</text>
			</view>
			<view @click="$gopage('/pages/bright/mycollection')">
				<image src="../../static/workMessage/enterprise_icon1.png" style="height: 63rpx;width: 52rpx;"></image>
				<text>我的收藏</text>
			</view>
		</view>
		<view class="card">
			<view>
				<text>税收优惠</text>
				<image src="../../static/workMessage/card1.png"></image>
			</view>
			<view>
				<text>财政支持</text>
				<image src="../../static/workMessage/card2.png"></image>
			</view>
			<view>
				<text>费金减免</text>
				<image src="../../static/workMessage/card3.png"></image>
			</view>
			<view>
				<text>政策兑换</text>
				<image src="../../static/workMessage/card4.png"></image>
			</view>
		</view>
		<view class="license">
			<view class="title">
				<text>企业证照</text>
				<text>更多</text>
			</view>
			<view class="box">
				<view class="logo">
					<view>
						<image src="../../static/workMessage/license.png"></image>
					</view>
					<text>营业执照</text>
				</view>
				<view class="more">查看详情</view>
			</view>
		</view>
		<view class="news_list">
			<view class="title">
				<text>政策推送</text>
				<!-- <text>全部</text> -->
			</view>
			<view class="list">
				<view class="list_box" v-for="item in pushList" :key="item.id" @click="toDetail(item)">
					<view>
						<text>{{ item.title }}</text>
						<image src="../../static/workMessage/right.png"></image>
					</view>
					<view>{{ item.pubTime?item.pubTime.substr(0,10):'' }}</view>
				</view>
				<uni-load-more status="nomore"></uni-load-more>
			</view>
		</view>
		<u-back-top :scroll-top="scrollTop" top="600"></u-back-top>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pushList: [],
				scrollTop: 0
			}
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;
		},
		onLoad() {
			this.getPushList();
		},
		methods: {
			getPushList() {
				this.$ajax({
					url: '/api/news/zwNewsPolicy/pushList',
					needAuth: true
				}).then(res => {
					if (res.code == 200) {
						this.pushList = res.data;
					}
				})
			},
			toDetail(item){
				uni.navigateTo({
					url:"/pages/bright/unscramble?id="+item.id
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.L-main {
		.nav {
			display: flex;
			padding: 0 60rpx;
			justify-content: space-between;
			padding-top: 40rpx;

			view {
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				align-items: center;

				image {}

				text {
					font-size: 28rpx;
					color: #333333;
					margin-top: 10rpx;
				}
			}
		}

		.card {
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;
			padding: 0 30rpx;
			margin-top: 45rpx;

			view {
				position: relative;
				width: 342rpx;
				height: 151rpx;
				padding: 16rpx 0 0 27rpx;
				box-sizing: border-box;
				margin-bottom: 10rpx;

				text {
					font-size: 28rpx;
					color: #fff;
				}

				image {
					height: 100%;
					width: 100%;
					position: absolute;
					left: 0;
					top: 0;
					z-index: -1;
				}
			}
		}

		.license {
			margin-top: 30rpx;
			padding: 0 30rpx;

			.box {
				height: 180rpx;
				background: url(../../static/workMessage/licenseBg.png) no-repeat;
				background-size: cover;
				position: relative;

				.logo {
					display: flex;
					align-items: center;
					position: absolute;
					left: 24rpx;
					top: 14rpx;

					view {
						image {
							width: 27rpx;
							height: 20rpx;
						}

						width: 45rpx;
						height: 45rpx;
						background-color: #ffffff;
						display: flex;
						justify-content: center;
						align-items: center;
						border-radius: 50%;
						margin-right: 12rpx;
					}

					text {
						color: #FFFFFF;
						font-size: 30rpx;
					}
				}

				.more {
					position: absolute;
					right: 42rpx;
					bottom: 30rpx;
					color: #fff;
					font-size: 26rpx;
				}
			}
		}

		.news_list {
			padding: 0 30rpx;
			margin-top: 20rpx;

			.list {
				.list_box {
					border-bottom: 1rpx solid #f1f1f1;
					padding-bottom: 20rpx;
					margin-bottom: 50rpx;

					view {
						&:nth-child(1) {
							display: flex;
							justify-content: space-between;
							align-items: center;
							margin-bottom: 20rpx;

							text {
								font-size: 28rpx;
								color: #333333;
								display: inline-block;
								width: 570rpx;
								overflow: hidden;
								display: -webkit-box;
								-webkit-line-clamp: 2;
								-webkit-box-orient: vertical;

							}

							image {
								width: 22rpx;
								height: 22rpx;
							}
						}

						&:nth-child(2) {
							color: #999999;
							font-size: 24rpx;
							text-align: right;
							padding-right: 25rpx;
						}
					}
					
					&:nth-last-child(2){
						margin-bottom: 0rpx;
					}
				}
			}
		}

		.title {
			height: 100rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			text {
				&:nth-child(1) {
					color: #333333;
					font-size: 34rpx;
					font-weight: bold;
				}

				&:nth-child(2) {
					color: #999999;
					font-size: 28rpx;
					display: flex;
					align-items: center;
					height: 100%;
				}
			}
		}
	}
</style>
